package com.heima.user.controller;

import com.heima.common.dto.ResponseResult;
import com.heima.user.entity.ApUser;
import com.heima.user.service.IApUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @BelongsProject: heima-leadnews
 * @BelongsPackage: com.heima.user.controller
 * @Author: wangjian
 * @CreateTime: 2022-07-06  18:35
 * @Description: TODO
 * @Version: 1.0
 */
@RestController
@RequestMapping("/api/v1/user")
@CrossOrigin
public class ApUserController {
    @Autowired
    private IApUserService apUserService;

    @GetMapping("/{id}")
    public ResponseResult<ApUser> getById(@PathVariable("id") Integer id) {
        ApUser apUser = apUserService.getById(id);
        return ResponseResult.okResult(apUser);
    }
}
